<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User menu</title>
</head>
<body>
<s:push value="user">
	<s:label> Usuario: </s:label>
	<s:text name="name" />
	<br>
	<s:label>Nuevas actividades</s:label>

	<s:form action="newActivity">

		<s:hidden name="id" />

		<s:textfield name="newActivityName" label="Nueva actividad" />

		<s:submit value="agregar actividad" />
	</s:form>

	<s:label>Nuevas tareas</s:label>
</s:push>
<s:form action="newTask">

</s:form>

<s:form action="newTask">
	<s:push value="user">
		<s:hidden name="id" />
		<s:select list="activities" label="Actividades actuales"
			name="selectedActivity" listKey="id" listValue="name"
			headerValue="--- Please Select ---" headerKey="1" required="true" />
	</s:push>

	<s:textfield name="newTaskName" label="Nueva tarea" />
	<s:textfield name="newTaskDuration" label="Tiempo tarea" />


	<s:select list="allCategories" label="Categoria de nueva tarea"
		name="selectedCategory" listKey="id" listValue="name"
		headerValue="--- Please Select ---" headerKey="1" required="true" />

	<s:submit value="agregar tarea" />

</s:form>

<s:label>Opciones</s:label>

<s:push value="user">
	<s:form action="showDuration">

		<s:select list="activities" label="Actividades actuales"
			name="selectedActivity" listKey="id" listValue="name"
			headerValue="--- Please Select ---" headerKey="1" required="true" />

		<s:hidden name="id" />

		<s:submit value="Duracion total" />

	</s:form>

</s:push>

<s:if test="%{ activityDuration != null }">
	<s:text name="activityDuration" />
</s:if>

<s:label>Modificar duracion de tareas</s:label>

<s:push value="user">

	<s:form action="viewTasks">

		<s:select list="activities" label="Actividades actuales"
			name="selectedActivity" listKey="id" listValue="name"
			headerValue="--- Please Select ---" headerKey="1" required="true" />

		<s:submit value="Ver tareas disponibles" />

	</s:form>

</s:push>



</body>
</html>
